-- GENERATED SPELL FOR [Shadowlord Deathwail] --


function spell0_22006(pUnit, Event) --@Death Coil,n/a--
pUnit:FullCastSpellOnTarget(32709,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22006', 3286, 1)
end

function spell1_22006(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(27641,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22006', 7000, 1)
end

function spell2_22006(pUnit, Event) --@Fel Fireball,n/a--
pUnit:FullCastSpellOnTarget(38312,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22006', 3000, 1)
end

function spell3_22006(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22006', 3000, 1)
end

function spell4_22006(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(15245,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22006', 3000, 1)
end

function Sorts_22006(pUnit, Event)
local choix_sorts_22006 = math.random(0, 4)
if choix_sorts_22006 == 0 then
pUnit:RegisterEvent('spell0_22006', 1, 1)
end
if choix_sorts_22006 == 1 then
pUnit:RegisterEvent('spell1_22006', 1, 1)
end
if choix_sorts_22006 == 2 then
pUnit:RegisterEvent('spell2_22006', 1, 1)
end
if choix_sorts_22006 == 3 then
pUnit:RegisterEvent('spell3_22006', 1, 1)
end
if choix_sorts_22006 == 4 then
pUnit:RegisterEvent('spell4_22006', 1, 1)
end
end

function mob22006_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22006', math.random(1500, 3000), 1)
end

function mob22006_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22006_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22006_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22006, 1, 'mob22006_Action')
RegisterUnitEvent(22006, 2, 'mob22006_Leave')
RegisterUnitEvent(22006, 3, 'mob22006_Kill')
RegisterUnitEvent(22006, 4, 'mob22006_Die')
